package com.fifth.commodity.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fifth.common.pojo.entity.BusinessInfo;
import com.fifth.common.pojo.entity.Goods;
import com.fifth.common.pojo.vo.SelectBusinessInfoByGNameVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface GoodsMapper extends BaseMapper<Goods> {

    List<Goods> selectAll(Goods goods);

    /*根据店铺id分页查询所有信息*/
    IPage<Goods> findGoodsByBusinessid(IPage<Goods> page,@Param("ew") Wrapper<Goods> queryWrapper);

    /*根据条件分页查询*/
    IPage<Goods> findAllGoods(IPage<Goods> page,@Param("ew") Wrapper<Goods> queryWrapper);

    /*根据goodsid查询商品信息*/
    Goods findGoodsByGoodsid(String id);

    /*模糊查询商品名查询对应店铺信息*/
    List<BusinessInfo> findBusinesByGNmae(String gname);

    /*查询店铺包含的所有商品*/
    IPage<Goods> selectGoodsInfoByBusinessId(IPage<Goods> page,@Param("ew") QueryWrapper<Goods> queryWrapper);

    Map<String,String> getSort(String userid);
}
